#include <iostream>
#include <math.h>

using namespace std;



long double value(long long n) {
	long double answer = 0;
	for (long long k = n; k >= 1; k--) {
			answer = answer + (long double)log10((long double)k);
	}	
	return answer;
}


long long minimize(long long n, long long r) {
     long double numerator = 0;
     long long one_denominator ;
     long long other_denominator;
     one_denominator = n - r;
     other_denominator = r;
     for (long long k = one_denominator + 1; k <= n; k++) {
         numerator = numerator + (long double) log10( (long double) k);
     }


     return floor(numerator - (value(other_denominator)));
 }


long long process(long long n, long long r) {
	return minimize(n, r);
}



int main() {
       long long n;
       long long m;
       while (cin >> n) {
               cin >> m;
               cout << process(n, m) + 1 << endl;
       }
}


